<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script src="../../jQuery/jquery-3.7.1.min.js"></script>
  </head>
  <body>
    <div class="container">
      </div>
    </div>
  </body>
  <script>
    console.log(window.location.href.split("?")[1].split("=")[1]);
    const courseId = window.location.href.split("?")[1].split("=")[1];
    $.ajax({
      url: `https://showme2.myhope365.com/online_course/pc/course/detail/${courseId}`,
      type: "get",
      success: function (res) {
        if (res.code === 0) {
          res.data.sections.forEach((item,index) => {
            $(".container").append(`
            <div>
                <h3>${item.sectionName}</h3>
                <div class='sectionName${index}'>

                </div>
            </div>
            `);
            item.subSections.forEach((item_1)=>{
                $(`.sectionName${index}`).append(`
                   <div>${item_1.sectionName} </div>
                `)
            })
            
          });
        }
      },
    });
  </script>
</html>
